<script>
	import {
		getCourseBigClassify
	} from "@/api/modules/appLaunch.js";

	export default {
		onLaunch: function() {
			getCourseBigClassify()
				.then((resp) => {
					
					uni.setStorage({
						key: 'courseTotalClassify',
						data: resp.data,
					});
					// uni.setStorage({
					// 	key: 'userChooseClassify',
					// 	data: resp.data,
					// });
					if(uni.getStorageSync('userChooseClassify') == "") // 未设置默认选择
					{
						let arr = JSON.parse(JSON.stringify(resp.data))
						
						for( let j = 0; j < arr.length; j++)
						{
							arr[j].show = "1"// 1表示显示
						}
						uni.setStorage({
							key: 'userChooseClassify',
							data: arr,
						});
					}
					else { 
						
					}
				})
				.catch((resp) => {})
			console.log('App Launch')

		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/* 此处为style标签内容的最前面 */
	@import "./static/iconfont.css";

	/*每个页面公共css */
	@import './static/common/css/public.css';
	/* 引入uView基础样式 */
	@import "uview-ui/index.scss";
</style>
